﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NewLife.Web;
using BingZi.HY.Core;
using System.Collections;
using System.Text;
using BingZi;

namespace FrameWork.web
{
    public partial class Messages : BaseTemplatePage
    {
        private string CMD = WebHelper.GetStringParam(HttpContext.Current.Request,"CMD","");
        public string ReturnScript = "";

        #region "==方法=="

        /// <summary>
        /// 绑定页面元素
        /// </summary>
        private void BindPageItem()
        {
            Hashtable puts = new Hashtable();

            MessageBox MBx = new MessageBox();
            ArrayList lst = new ArrayList();
            if (CMD == "AppError")
            {
                List<sys_NavigationUrl> ListUrl = new List<sys_NavigationUrl>();
                ListUrl.Add(new sys_NavigationUrl("确定", "/index.aspx", "", UrlType.Href, true));

                MBx.M_Body = "抱歉，处理您的请求时发生了错误。错误信息已被记录，我们将追踪解决。";
                MBx.M_Title = "系统错误";
                MBx.M_IconType = Icon_Type.Error;
                MBx.M_ButtonList = ListUrl;
            }
            else
            {
                string CookiesKey = string.Format("{0}-MessageValue", Common.Get_CookiesName);

                string MessageValue = Request.Cookies[CookiesKey].Value.ToString();

                if (MessageValue != "")
                {
                    MBx = EventMessage.Deserialize_MessageBox(EventMessage.Deserialize_MessageBox(MessageValue, true));
                }

            }

            String M_ReturnScript = MBx.M_ReturnScript;
            BasePage_Title = MBx.M_Title;
            lst.Add(MBx);
            puts.Add("ReturnScript", M_ReturnScript);
            puts.Add("DataList", lst);
            Response.Write(ViewTemplate(EnumTemplateFile.Messages, puts));
        }




        #endregion



        #region "==事件=="


        /// <summary>
        /// 页面加载
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                //绑定页面元素
                BindPageItem();


            }

        }




        #endregion
    }
}